[IA64] efi: remove old efi code to copmile newer linux acpi code.
authorIsaku Yamahata <yamahata@valinux.co.jp>
Wed, 11 Jun 2008 07:57:42 +0000 (16:57 +0900)
committerIsaku Yamahata <yamahata@valinux.co.jp>
Wed, 11 Jun 2008 07:57:42 +0000 (16:57 +0900)
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
xen/arch/ia64/linux-xen/efi.c
xen/arch/ia64/xen/dom_fw_dom0.c
xen/arch/ia64/xen/pcdp.c
xen/arch/ia64/xen/xensetup.c
xen/include/asm-ia64/linux-xen/linux/efi.h

index ecc64f730e5b138538ca926f01fac5e0c1e30cee..3eebc229ddae0e5b5939b4c9ba6aed86afa81676 100644 (file)
@@ -504,7 +504,6 @@ efi_init (void)
        printk(KERN_INFO "EFI v%u.%.02u by %s:",
               efi.systab->hdr.revision >> 16, efi.systab->hdr.revision & 0xffff, vendor);
 
-#ifndef XEN
        efi.mps        = EFI_INVALID_TABLE_ADDR;
        efi.acpi       = EFI_INVALID_TABLE_ADDR;
        efi.acpi20     = EFI_INVALID_TABLE_ADDR;
@@ -535,31 +534,6 @@ efi_init (void)
                        printk(" HCDP=0x%lx", config_tables[i].table);
                }
        }
-#else
-       /* Members of efi are set with virtual address in old linux code.
-          The latest linux set wiht physicall address. */
-       for (i = 0; i < (int) efi.systab->nr_tables; i++) {
-               if (efi_guidcmp(config_tables[i].guid, MPS_TABLE_GUID) == 0) {
-                       efi.mps = __va(config_tables[i].table);
-                       printk(" MPS=0x%lx", config_tables[i].table);
-               } else if (efi_guidcmp(config_tables[i].guid, ACPI_20_TABLE_GUID) == 0) {
-                       efi.acpi20 = __va(config_tables[i].table);
-                       printk(" ACPI 2.0=0x%lx", config_tables[i].table);
-               } else if (efi_guidcmp(config_tables[i].guid, ACPI_TABLE_GUID) == 0) {
-                       efi.acpi = __va(config_tables[i].table);
-                       printk(" ACPI=0x%lx", config_tables[i].table);
-               } else if (efi_guidcmp(config_tables[i].guid, SMBIOS_TABLE_GUID) == 0) {
-                       efi.smbios = __va(config_tables[i].table);
-                       printk(" SMBIOS=0x%lx", config_tables[i].table);
-               } else if (efi_guidcmp(config_tables[i].guid, SAL_SYSTEM_TABLE_GUID) == 0) {
-                       efi.sal_systab = __va(config_tables[i].table);
-                       printk(" SALsystab=0x%lx", config_tables[i].table);
-               } else if (efi_guidcmp(config_tables[i].guid, HCDP_TABLE_GUID) == 0) {
-                       efi.hcdp = __va(config_tables[i].table);
-                       printk(" HCDP=0x%lx", config_tables[i].table);
-               }
-       }
-#endif
        printk("\n");
 
        runtime = __va(efi.systab->runtime);
index 18ba4ebfc392064c9307ea6c672ef2cb2e977dbe..43ca7908a171ec83c16020c86e35b354ee50f224 100644 (file)
@@ -212,33 +212,33 @@ void __init efi_systable_init_dom0(struct fw_tables *tables)
 
        /* Write messages to the console.  */
        printk("Domain0 EFI passthrough:");
-       if (efi.mps) {
+       if (efi.mps != EFI_INVALID_TABLE_ADDR) {
                tables->efi_tables[i].guid = MPS_TABLE_GUID;
-               tables->efi_tables[i].table = __pa(efi.mps);
+               tables->efi_tables[i].table = efi.mps;
                printk(" MPS=0x%lx", tables->efi_tables[i].table);
                i++;
        }
-       if (efi.acpi20) {
+       if (efi.acpi20 != EFI_INVALID_TABLE_ADDR) {
                tables->efi_tables[i].guid = ACPI_20_TABLE_GUID;
-               tables->efi_tables[i].table = __pa(efi.acpi20);
+               tables->efi_tables[i].table = efi.acpi20;
                printk(" ACPI 2.0=0x%lx", tables->efi_tables[i].table);
                i++;
        }
-       if (efi.acpi) {
+       if (efi.acpi != EFI_INVALID_TABLE_ADDR) {
                tables->efi_tables[i].guid = ACPI_TABLE_GUID;
-               tables->efi_tables[i].table = __pa(efi.acpi);
+               tables->efi_tables[i].table = efi.acpi;
                printk(" ACPI=0x%lx", tables->efi_tables[i].table);
                i++;
        }
-       if (efi.smbios) {
+       if (efi.smbios != EFI_INVALID_TABLE_ADDR) {
                tables->efi_tables[i].guid = SMBIOS_TABLE_GUID;
-               tables->efi_tables[i].table = __pa(efi.smbios);
+               tables->efi_tables[i].table = efi.smbios;
                printk(" SMBIOS=0x%lx", tables->efi_tables[i].table);
                i++;
        }
-       if (efi.hcdp) {
+       if (efi.hcdp != EFI_INVALID_TABLE_ADDR) {
                tables->efi_tables[i].guid = HCDP_TABLE_GUID;
-               tables->efi_tables[i].table = __pa(efi.hcdp);
+               tables->efi_tables[i].table = efi.hcdp;
                printk(" HCDP=0x%lx", tables->efi_tables[i].table);
                i++;
        }
index b7851792666dac9a7963e452b29d2ac98a62e766..102f2c4e3eb5b394031a6569be75fd0a5e79d0d8 100644 (file)
@@ -146,10 +146,17 @@ setup_serial_console(struct pcdp_uart *uart)
        if (uart->bits)
                ns16550_com1.data_bits = uart->bits;
 
+#ifndef XEN
        setup_pcdp_irq(efi.hcdp, uart);
 
        /* Hide the HCDP table from dom0, xencons will be the console */
        efi.hcdp = NULL;
+#else
+       setup_pcdp_irq(__va(efi.hcdp), uart);
+
+       /* Hide the HCDP table from dom0, xencons will be the console */
+       efi.hcdp = EFI_INVALID_TABLE_ADDR;
+#endif
 
        return 0;
 }
@@ -227,9 +234,15 @@ efi_setup_pcdp_console(char *cmdline)
        struct pcdp_device *dev, *end;
        int i, serial = 0;
 
+#ifndef XEN
        pcdp = efi.hcdp;
        if (!pcdp)
                return -ENODEV;
+#else
+       if (efi.hcdp == EFI_INVALID_TABLE_ADDR)
+               return -ENODEV;
+       pcdp = __va(efi.hcdp);
+#endif
 
        printk(KERN_INFO "PCDP: v%d at 0x%lx\n", pcdp->rev, __pa(pcdp));
 
index d6aa79c246bbd72be250fcc50069e785cd9a5ad7..fc88e929c817fcc7b91ef35ad09a18dc2d7a3f07 100644 (file)
@@ -557,7 +557,8 @@ skip_move:
 
     /* process SAL system table */
     /* must be before any pal/sal call */
-    ia64_sal_init(efi.sal_systab);
+    BUG_ON(efi.sal_systab == EFI_INVALID_TABLE_ADDR);
+    ia64_sal_init(__va(efi.sal_systab));
 
     /* early_setup_arch() maps PAL code. */
     identify_vmx_feature();
index aeb349c7d5bd9542cc9e360255c402428a74d79f..451bbd16e1a7fdda369b64fcac05558e6caa882a 100644 (file)
@@ -256,7 +256,6 @@ struct efi_memory_map {
  */
 extern struct efi {
        efi_system_table_t *systab;     /* EFI system table */
-#ifndef XEN
        unsigned long mps;              /* MPS table */
        unsigned long acpi;             /* ACPI table  (IA64 ext 0.71) */
        unsigned long acpi20;           /* ACPI table  (ACPI 2.0) */
@@ -265,16 +264,6 @@ extern struct efi {
        unsigned long boot_info;        /* boot info table */
        unsigned long hcdp;             /* HCDP table */
        unsigned long uga;              /* UGA table */
-#else
-       void *mps;                      /* MPS table */
-       void *acpi;                     /* ACPI table  (IA64 ext 0.71) */
-       void *acpi20;                   /* ACPI table  (ACPI 2.0) */
-       void *smbios;                   /* SM BIOS table */
-       void *sal_systab;               /* SAL system table */
-       void *boot_info;                /* boot info table */
-       void *hcdp;                     /* HCDP table */
-       void *uga;                      /* UGA table */
-#endif
        efi_get_time_t *get_time;
        efi_set_time_t *set_time;
        efi_get_wakeup_time_t *get_wakeup_time;